package com.onetech.adrewards.free.objects;

import org.json.JSONObject;

import com.onetech.adrewards.free.http.APIRequestResult;

public class SendMailSuccessDTO {

	
	private String succes_message;
	private String error_code;
	private String error_message;
	
	public SendMailSuccessDTO(APIRequestResult data){
		if(data != null)
		{
			setError_code(data.error_code);
			setError_message(data.error_msg);
			try
			
			{
			if (data.error_code.equals("0") && data.data != null && !data.data.equals("")) {
				JSONObject jb=(JSONObject)data.data;
				JSONObject temp = jb.getJSONObject("result");
				
				if(temp!=null ){
					setSuccessMessage(temp.getString("success_msg"));
				}
			}
			}
			catch(Exception ex)
			{
				
			}
		}
	}
	
	public SendMailSuccessDTO(){
		
		setError_code("0");
		setError_message("");
	}
	
	public String getError_code() {
		return error_code;
	}
	public void setError_code(String error_code) {
		this.error_code = error_code;
	}
	public String getError_message() {
		return this.error_message;
	}
	public void setError_message(String error_message) {
		this.error_message = error_message;
	}
	
	public String getSuccessMessage() {
		return succes_message;
	}
	public void setSuccessMessage(String msg) {
		this.succes_message = msg;
	}
}
